home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / CNews / Source / inject / makefile < prev    next >
Encoding:
Makefile  |  1992-04-29  |  3.2 KB  |  113 lines

  1. # makefile for C news inews and relatives
  2.  
  3. # =()<NEWSARTS = @<NEWSARTS>@>()=
  4. NEWSARTS = /usr/spool/news
  5. # =()<NEWSBIN = @<NEWSBIN>@>()=
  6. NEWSBIN = /usr/lib/newsbin
  7. # =()<NEWSCTL = @<NEWSCTL>@>()=
  8. NEWSCTL = /usr/lib/news
  9. # workaround for System V make bug
  10. SHELL = /bin/sh
  11.  
  12. CMDS=actflag defaults defhdrs.awk inews lines modroute injnews pnews stripinvis submit.relay tear
  13. BIN=/bin
  14. NPROC=2
  15. # -DVOID=int for libc.h & old lint libraries
  16. #DEFINES= -I../include -I../relay -I. -DVOID=int
  17. DEFINES= -I../h -I../relay -I. -DVOID=int
  18. #CC=CC +V
  19. #CC=gcc -ansi -pedantic -Wall -S
  20. COPTS= -O # -pg -g -O
  21. CFLAGS=$(DEFINES) $(COPTS)
  22. DBM = # -ldbm
  23. LIBS= $(DBM)
  24. LINT=lint
  25. LINTFLAGS=-haz $(DEFINES)
  26. LLIBS= # -lmalloc
  27. # I wish I could make lint shut the fk up about some things.  Grrr!
  28. LINTFILT=egrep -v '(possible pointer|long assign|nnfree|getdate|:$$)'
  29. PROPTS=
  30. P=stpr
  31. PP=pp -Tpsc -fR # lazywriter
  32. PPBACK=dps | stps # lazywriter
  33.  
  34. LIBOBJS=../libcnews.a
  35. SRC=# ...
  36. OBJ=# ...
  37. FILES=$(NONCFILES) $(CFILES)
  38. NONCFILES= TODO* README ads/README ads/[0-9]* \
  39.     inews injnews pnews tear defhdrs.awk makefile
  40. CFILES= ../include/*.h  $(SRC)
  41.  
  42. all: makefile $(CMDS)
  43.     chmod +x $(CMDS)
  44.  
  45. lint: lint.defaults lint.actflag
  46.  
  47. mkfile: makefile
  48.     sed '/mkfile/d' makefile | mkconv | sed 's/make/mk/g' >$@
  49.  
  50. actflag: actflag.o ../relay/active.o $(LIBOBJS)
  51.     $(CC) $(CFLAGS) $(LDFLAGS) actflag.o ../relay/active.o $(PRE) $(LIBS) $(LIBOBJS) $(POST) -o $@
  52. lint.actflag: $(SRC)
  53.     $(LINT) $(LINTFLAGS) actflag.c $(LLIBS) 2>&1 | $(LINTFILT)
  54. lint-p.actflag: $(SRC)
  55.     $(LINT) $(LINTFLAGS) -p actflag.c $(LLIBS) 2>&1 | $(LINTFILT)
  56.  
  57. defaults: defaults.o fullname.o getmypwent.o intcode.o $(LIBOBJS)
  58.     $(CC) $(CFLAGS) $(LDFLAGS) defaults.o fullname.o getmypwent.o intcode.o $(PRE) $(LIBS) $(LIBOBJS) $(POST) -o $@
  59. lint.defaults: $(SRC)
  60.     $(LINT) $(LINTFLAGS) defaults.c fullname.c getmypwent.c intcode.c $(LLIBS) 2>&1 | $(LINTFILT)
  61. lint-p.defaults: $(SRC)
  62.     $(LINT) $(LINTFLAGS) -p defaults.c fullname.c getmypwent.c intcode.c $(LLIBS) 2>&1 | $(LINTFILT)
  63.  
  64. stripinvis: mkstripinvis
  65.     chmod +x mkstripinvis
  66.     ./mkstripinvis >$@
  67.     chmod +x $@
  68.  
  69. # this botch is for backward compatibility
  70. newsinstall: $(NEWSBIN)/inject/inews
  71.     rm -f $(NEWSCTL)/inews
  72.     ln $(NEWSBIN)/inject/inews $(NEWSCTL)/inews 2>/dev/null || cp inews $(NEWSCTL)
  73.  
  74. # bininstall: make directories, install programs
  75. bininstall: install
  76. install $(NEWSBIN)/inject/inews: $(CMDS)
  77.     -mkdir $(NEWSBIN)/inject
  78.     cp $(CMDS) $(NEWSBIN)/inject
  79.     rm -f $(BIN)/inews $(BIN)/injnews
  80.     ln $(NEWSBIN)/inject/inews $(BIN)/inews 2>/dev/null || cp inews $(BIN)
  81.     ln $(NEWSBIN)/inject/injnews $(BIN)/injnews 2>/dev/null || cp injnews $(BIN)
  82.  
  83. cmp:
  84.     for f in $(CMDS) ; do cmp $(NEWSBIN)/inject/$$f $$f ; done
  85.     cmp $(BIN)/inews inews
  86.     cmp $(NEWSCTL)/inews inews
  87.  
  88. check:
  89.     for f in $(CMDS) ; do cmp $(NEWSBIN)/inject/$$f $$f || true ; done
  90.     cmp $(BIN)/inews inews || true
  91.     cmp $(NEWSCTL)/inews inews || true
  92.  
  93. TODO.grep: TODO
  94.     -egrep TODO ../include/*.h *.h *.c * | tr -s " \11" " " >$@
  95.     -egrep TODO ../lib*/*.[ch] | tr -s " \11" " " >>$@
  96.  
  97. print: printc printnonc
  98.     touch $@
  99. printc: $(CFILES)
  100.     $(PP) $? | $(PPBACK)
  101.     touch $@
  102. printnonc: $(NONCFILES)
  103.     pr $(PROPTS) $? | $P
  104.     touch $@
  105. clean:
  106.     rm -rf core a.out *.o regress/tmp actflag defaults
  107.  
  108. r: $(CMDS)
  109.     chmod +x regress/regress
  110.     (cd regress; ./regress)
  111.     
  112. # header dependencies follow
  113.